/*
 * Created on 2006-7-20
 */
package entity;

import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;

import geometry.Circle;

public class ShowCells extends Applet {
	String s2show = "This is the cell cover";
	int numCells = 10;
	int slength = 30;
	Field field = new Field(numCells, numCells, slength);

	// Field field = new Field(10, 10, 50);

	public void paint(Graphics g) {
		// g.drawString(this.s2show,50,50);
		// g.drawLine(25,25,100,100);
		// g.drawRect(20,20,10,10);
		// g.drawRect(100,100,10,10);
		// g.drawRect(0, 0, field.getWidth(), field.getHeight());
		int l = field.cellLength;
		for (int r = 0; r < this.field.numCellsPerRow; r++) {
			for (int c = 0; c < this.field.numCellsPerCol; c++) {
				Cell cell = field.getCell(r, c);
				// System.out.println("r:"+r+"c:"+c);
				// System.out.println("top left: " + cell.x + "," + cell.y);
				g.drawRect(r * l, c * l, l, l);
				// g.drawString(cell.toString(), (int) cell.x, (int) cell.y);

			}
		}

		MovingObject mo1 = null;
		
		Point2D p = new Point2D.Double(30, 30);
				Circle circle = new Circle(p, 10);
		Graphics2D ga = (Graphics2D) g;
//		
//		ga.draw(mo1);
//		ga.setPaint(Color.green);
//		ga.fill(mo1);
		
		
//		System.out.println(mo1.getCenterY());
//		
//		System.out.println(mo1.getX());
//		System.out.println(mo1.getY());
//		ga.draw(circle.getBounds());
		// //
		// Rectangle r = new Rectangle(1, 1, 50,50);
		// Point p = new Point(5,5);
		// System.out.println(r.contains(p));
		//
		// g.drawRect(1, 1, 50, 50);
		// // g.drawOval(5, 5, 10, 10);
		// g.fillOval(1, 1, 10, 10);

	}
}